package com.tt.utils;

import java.io.IOException;
import java.io.Reader;

import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import org.springframework.stereotype.Component;

public class GetResult {
	public static SqlSession getSqlSession() throws IOException{
		String res = "Configuration.xml";
		Reader reader = Resources.getResourceAsReader(res);
		SqlSessionFactory ssf =new SqlSessionFactoryBuilder().build(reader);
		SqlSession ss = ssf.openSession();
		return ss;
	}
}
